package Service_de_nommage;
import java.net.*;
import java.util.StringTokenizer;
import java.io.*;


/**
 * Serveur HTTP qui joue le role d'un serveur de nom
 * Reception et envoi des references des machines
 * 
 * @author Hamdi Ayed
 *
 */
class Server {
    
    Socket sock;
    BufferedReader in;
    DataOutputStream out;
    ServerSocket ss;
   
    public Server(){
    	try{
              ss = new ServerSocket(3000);
              while(true) {
            	System.out.println("Attente requetes...");
                Socket s = ss.accept();
                sock = s ;
                in = new BufferedReader(new InputStreamReader(sock.getInputStream()));
                out = new DataOutputStream(sock.getOutputStream());
                new ReponseRequete(sock).start();
              }
        }
        catch(IOException e) {System.out.println(e);}
    }
       
    
    public static void main(String[] args) {
    	Server serv= new Server();		
		}
}